package xyz.labmem.base.core.base

import io.swagger.annotations.ApiModelProperty
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import java.io.Serializable
import javax.validation.constraints.Min

/**
 * @Author lty
 * @Date 2021/4/6 17:13
 */
open class BasePage : Serializable {
    @ApiModelProperty(value = "页码 默认第一页", required = true)
    @Min(value = 1, message = "页数最小为1", groups = [BaseVerify.page::class])
    var pageNo: Long = 1

    @ApiModelProperty(value = "条数 默认十条", required = true)
    @Min(value = 1, message = "条数最小为1", groups = [BaseVerify.page::class])
    var pageSize: Long = 10

    fun <T> IPage(): Page<T> {
        return Page(pageNo, pageSize)
    }
}